package auctionatr

import grails.test.*

class BidTests extends GrailsUnitTestCase {
    def testauction 

   def bid   
   
   def testuser
   
   def testbid 
	
    
	protected void setUp() {
        super.setUp()
		
		
		
		 
		testuser = new User(username:'testuser',password:'pass',email:'test@test.de',birthday:(new Date() - 365*30),facebookName: 'admin', aboutUser: 'here i am', twitterName: 'admin', firstName: 'ad', lastName: 'min', street: 'here', zip: 8990, city: 'Stuttgart', accountNumber: 343443, bankCode: 'eee',role:'user',avatar: null, avatarType: null,)
		

		testauction = new Auction(
			name:"iPhone 4",
			description:"Ich verkaufe ein nagelneues iPhone 4!",
			startPrice:1.0,
			startDate:new Date(),
			
			deliveryCosts: 0,
			
			finishDate:(new Date()+1),
			
			category:"Computer und Software",
			shipment:"UPS",
			state:"neu",
			picture:null,
			pictureType:null,
			users:testuser,
			)
		
		
		bid = new Bid(
			gebot:10.0,
			users:testuser,
			auctions:testauction,
			)
		
		
		testbid = new Bid(
			gebot:120.0,
		
			users: testuser,
			auctions: testauction,
			)
	
		mockDomain(User,[testuser])
		mockDomain(Auction,[testauction])
		mockDomain(Bid,[bid,testbid])
				
    }
	
	
	
    protected void tearDown() {
        super.tearDown()
    }

    void testGebot() {
		assertEquals 2, Bid.count()
		
		
		
		//assertTrue "Validation should succeed",
			//bid.validate()
			
		
		
	
		
    }
}
